#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: splice04_sole_dml.py 
@version:
@time: 2022/03/08 
"""
from TapClientCaseData.ColumnGenerateData.dynamic.base.base00_dynamic import SQLSERVER06_TYPE
from TapClientCaseData.ColumnGenerateData.dynamic.base.base00_dynamic import GET
from TapClientCaseData.ColumnGenerateData.dynamic.base.base00_dynamic import GET_UPDATE

__all__ = [
    'DML_SQLSERVER_COMMON_WHERE',
    'DML_SQLSERVER_TINYINT', 'DML_SQLSERVER_SMALLINT', 'DML_SQLSERVER_INT', 'DML_SQLSERVER_BIGINT',
    'DML_SQLSERVER_DECIMAL',
    'DML_SQLSERVER_NUMERIC', 'DML_SQLSERVER_BIT', 'DML_SQLSERVER_SMALLMONEY', 'DML_SQLSERVER_MONEY',

    'DML_SQLSERVER_FLOAT', 'DML_SQLSERVER_REAL', 'DML_SQLSERVER_DATE', 'DML_SQLSERVER_DATETIMEOFFSET',
    'DML_SQLSERVER_DATETIME2', 'DML_SQLSERVER_SMALLDATETIME', 'DML_SQLSERVER_DATETIME', 'DML_SQLSERVER_TIME',

    'DML_SQLSERVER_CHAR', 'DML_SQLSERVER_VARCHAR', 'DML_SQLSERVER_TEXT', 'DML_SQLSERVER_NCHAR',
    'DML_SQLSERVER_NVARCHAR',
    'DML_SQLSERVER_NTEXT', 'DML_SQLSERVER_BINARY', 'DML_SQLSERVER_VARBINARY', 'DML_SQLSERVER_IMAGE',
    'DML_SQLSERVER_XML',

    'DML_SQLSERVER_TINYINT_INSERT_1', 'DML_SQLSERVER_TINYINT_INSERT_2', 'DML_SQLSERVER_TINYINT_UPDATE',
    'DML_SQLSERVER_SMALLINT_INSERT_1', 'DML_SQLSERVER_SMALLINT_INSERT_2', 'DML_SQLSERVER_SMALLINT_UPDATE',
    'DML_SQLSERVER_INT_INSERT_1', 'DML_SQLSERVER_INT_INSERT_2', 'DML_SQLSERVER_INT_UPDATE',
    'DML_SQLSERVER_BIGINT_INSERT_1', 'DML_SQLSERVER_BIGINT_INSERT_2', 'DML_SQLSERVER_BIGINT_UPDATE',
    'DML_SQLSERVER_DECIMAL_INSERT_1', 'DML_SQLSERVER_DECIMAL_INSERT_2', 'DML_SQLSERVER_DECIMAL_UPDATE',
    'DML_SQLSERVER_NUMERIC_INSERT_1', 'DML_SQLSERVER_NUMERIC_INSERT_2', 'DML_SQLSERVER_NUMERIC_UPDATE',
    'DML_SQLSERVER_BIT_INSERT_1', 'DML_SQLSERVER_BIT_INSERT_2', 'DML_SQLSERVER_BIT_UPDATE',
    'DML_SQLSERVER_SMALLMONEY_INSERT_1', 'DML_SQLSERVER_SMALLMONEY_INSERT_2', 'DML_SQLSERVER_SMALLMONEY_UPDATE',
    'DML_SQLSERVER_MONEY_INSERT_1', 'DML_SQLSERVER_MONEY_INSERT_2', 'DML_SQLSERVER_MONEY_UPDATE',

    'DML_SQLSERVER_FLOAT_INSERT_1', 'DML_SQLSERVER_FLOAT_INSERT_2', 'DML_SQLSERVER_FLOAT_UPDATE',
    'DML_SQLSERVER_REAL_INSERT_1', 'DML_SQLSERVER_REAL_INSERT_2', 'DML_SQLSERVER_REAL_UPDATE',

    'DML_SQLSERVER_DATE_INSERT_1', 'DML_SQLSERVER_DATE_INSERT_2', 'DML_SQLSERVER_DATE_UPDATE',
    'DML_SQLSERVER_DATETIMEOFFSET_INSERT_1', 'DML_SQLSERVER_DATETIMEOFFSET_INSERT_2',
    'DML_SQLSERVER_DATETIMEOFFSET_UPDATE',
    'DML_SQLSERVER_DATETIME2_INSERT_1', 'DML_SQLSERVER_DATETIME2_INSERT_2', 'DML_SQLSERVER_DATETIME2_UPDATE',
    'DML_SQLSERVER_SMALLDATETIME_INSERT_1', 'DML_SQLSERVER_SMALLDATETIME_INSERT_2',
    'DML_SQLSERVER_SMALLDATETIME_UPDATE',
    'DML_SQLSERVER_DATETIME_INSERT_1', 'DML_SQLSERVER_DATETIME_INSERT_2', 'DML_SQLSERVER_DATETIME_UPDATE',
    'DML_SQLSERVER_TIME_INSERT_1', 'DML_SQLSERVER_TIME_INSERT_2', 'DML_SQLSERVER_TIME_UPDATE',

    'DML_SQLSERVER_CHAR_INSERT_1', 'DML_SQLSERVER_CHAR_INSERT_2', 'DML_SQLSERVER_CHAR_UPDATE',
    'DML_SQLSERVER_VARCHAR_INSERT_1', 'DML_SQLSERVER_VARCHAR_INSERT_2', 'DML_SQLSERVER_VARCHAR_UPDATE',
    'DML_SQLSERVER_TEXT_INSERT_1', 'DML_SQLSERVER_TEXT_INSERT_2', 'DML_SQLSERVER_TEXT_UPDATE',

    'DML_SQLSERVER_NCHAR_INSERT_1', 'DML_SQLSERVER_NCHAR_INSERT_2', 'DML_SQLSERVER_NCHAR_UPDATE',
    'DML_SQLSERVER_NVARCHAR_INSERT_1', 'DML_SQLSERVER_NVARCHAR_INSERT_2', 'DML_SQLSERVER_NVARCHAR_UPDATE',
    'DML_SQLSERVER_NTEXT_INSERT_1', 'DML_SQLSERVER_NTEXT_INSERT_2', 'DML_SQLSERVER_NTEXT_UPDATE',

    'DML_SQLSERVER_BINARY_INSERT_1', 'DML_SQLSERVER_BINARY_INSERT_2', 'DML_SQLSERVER_BINARY_UPDATE',
    'DML_SQLSERVER_VARBINARY_INSERT_1', 'DML_SQLSERVER_VARBINARY_INSERT_2', 'DML_SQLSERVER_VARBINARY_UPDATE',
    'DML_SQLSERVER_IMAGE_INSERT_1', 'DML_SQLSERVER_IMAGE_INSERT_2', 'DML_SQLSERVER_IMAGE_UPDATE',

    'DML_SQLSERVER_XML_INSERT_1', 'DML_SQLSERVER_XML_INSERT_2', 'DML_SQLSERVER_XML_UPDATE'
]


def SOLE_GET_INSERT1(dictionary):
    return [dictionary.get('COLUMNS'), dictionary.get('INSERT_1')]


def SOLE_GET_INSERT2(dictionary):
    return [dictionary.get('COLUMNS'), dictionary.get('INSERT_2')]


# ---------- SOLE DML ----------
DML_SQLSERVER_COMMON = GET(SQLSERVER06_TYPE, 'COMMON')
DML_SQLSERVER_COMMON_WHERE = GET(DML_SQLSERVER_COMMON, 'WHERE')
SQLSERVER06_DML_TYPE = SQLSERVER06_TYPE.get('COLUMNS')

# ---- EXACT_NUMERICS

DML_SQLSERVER_EXACT_NUMERICS = GET(SQLSERVER06_DML_TYPE, 'EXACT_NUMERICS')
# -- tinyint --
DML_SQLSERVER_TINYINT = GET(DML_SQLSERVER_EXACT_NUMERICS, 'tinyint')
DML_SQLSERVER_TINYINT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_TINYINT)
DML_SQLSERVER_TINYINT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_TINYINT)
DML_SQLSERVER_TINYINT_UPDATE = GET_UPDATE(DML_SQLSERVER_TINYINT)
# -- smallint --
DML_SQLSERVER_SMALLINT = GET(DML_SQLSERVER_EXACT_NUMERICS, 'smallint')
DML_SQLSERVER_SMALLINT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_SMALLINT)
DML_SQLSERVER_SMALLINT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_SMALLINT)
DML_SQLSERVER_SMALLINT_UPDATE = GET_UPDATE(DML_SQLSERVER_SMALLINT)
# -- int --
DML_SQLSERVER_INT = GET(DML_SQLSERVER_EXACT_NUMERICS, 'int')
DML_SQLSERVER_INT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_INT)
DML_SQLSERVER_INT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_INT)
DML_SQLSERVER_INT_UPDATE = GET_UPDATE(DML_SQLSERVER_INT)
# -- bigint --
DML_SQLSERVER_BIGINT = GET(DML_SQLSERVER_EXACT_NUMERICS, 'bigint')
DML_SQLSERVER_BIGINT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_BIGINT)
DML_SQLSERVER_BIGINT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_BIGINT)
DML_SQLSERVER_BIGINT_UPDATE = GET_UPDATE(DML_SQLSERVER_BIGINT)
# -- decimal --
DML_SQLSERVER_DECIMAL = GET(DML_SQLSERVER_EXACT_NUMERICS, 'decimal')
DML_SQLSERVER_DECIMAL_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_DECIMAL)
DML_SQLSERVER_DECIMAL_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_DECIMAL)
DML_SQLSERVER_DECIMAL_UPDATE = GET_UPDATE(DML_SQLSERVER_DECIMAL)
# --numeric --
DML_SQLSERVER_NUMERIC = GET(DML_SQLSERVER_EXACT_NUMERICS, 'numeric')
DML_SQLSERVER_NUMERIC_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_NUMERIC)
DML_SQLSERVER_NUMERIC_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_NUMERIC)
DML_SQLSERVER_NUMERIC_UPDATE = GET_UPDATE(DML_SQLSERVER_NUMERIC)
# -- bit --
DML_SQLSERVER_BIT = GET(DML_SQLSERVER_EXACT_NUMERICS, 'bit')
DML_SQLSERVER_BIT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_BIT)
DML_SQLSERVER_BIT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_BIT)
DML_SQLSERVER_BIT_UPDATE = GET_UPDATE(DML_SQLSERVER_BIT)
# --smallmoney --
DML_SQLSERVER_SMALLMONEY = GET(DML_SQLSERVER_EXACT_NUMERICS, 'smallmoney')
DML_SQLSERVER_SMALLMONEY_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_SMALLMONEY)
DML_SQLSERVER_SMALLMONEY_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_SMALLMONEY)
DML_SQLSERVER_SMALLMONEY_UPDATE = GET_UPDATE(DML_SQLSERVER_SMALLMONEY)
# --money --
DML_SQLSERVER_MONEY = GET(DML_SQLSERVER_EXACT_NUMERICS, 'money')
DML_SQLSERVER_MONEY_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_MONEY)
DML_SQLSERVER_MONEY_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_MONEY)
DML_SQLSERVER_MONEY_UPDATE = GET_UPDATE(DML_SQLSERVER_MONEY)

# ---- APPROXIMATE_NUMERICS ----
DML_APPROXIMATE_NUMERICS = GET(SQLSERVER06_DML_TYPE, 'APPROXIMATE_NUMERICS')
# -- float --
DML_SQLSERVER_FLOAT = GET(DML_APPROXIMATE_NUMERICS, 'float')
DML_SQLSERVER_FLOAT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_FLOAT)
DML_SQLSERVER_FLOAT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_FLOAT)
DML_SQLSERVER_FLOAT_UPDATE = GET_UPDATE(DML_SQLSERVER_FLOAT)
# -- real --
DML_SQLSERVER_REAL = GET(DML_APPROXIMATE_NUMERICS, 'real')
DML_SQLSERVER_REAL_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_REAL)
DML_SQLSERVER_REAL_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_REAL)
DML_SQLSERVER_REAL_UPDATE = GET_UPDATE(DML_SQLSERVER_REAL)

# ---- DATE_AND_TIME ----
DML_SQLSERVER_DATE_AND_TIME = GET(SQLSERVER06_DML_TYPE, 'DATE_AND_TIME')
# -- date --
DML_SQLSERVER_DATE = GET(DML_SQLSERVER_DATE_AND_TIME, 'date')
DML_SQLSERVER_DATE_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_DATE)
DML_SQLSERVER_DATE_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_DATE)
DML_SQLSERVER_DATE_UPDATE = GET_UPDATE(DML_SQLSERVER_DATE)

# -- datetimeoffset --
DML_SQLSERVER_DATETIMEOFFSET = GET(DML_SQLSERVER_DATE_AND_TIME, 'datetimeoffset')
DML_SQLSERVER_DATETIMEOFFSET_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_DATETIMEOFFSET)
DML_SQLSERVER_DATETIMEOFFSET_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_DATETIMEOFFSET)
DML_SQLSERVER_DATETIMEOFFSET_UPDATE = GET_UPDATE(DML_SQLSERVER_DATETIMEOFFSET)
# -- datetime2 --
DML_SQLSERVER_DATETIME2 = GET(DML_SQLSERVER_DATE_AND_TIME, 'datetime2')
DML_SQLSERVER_DATETIME2_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_DATETIME2)
DML_SQLSERVER_DATETIME2_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_DATETIME2)
DML_SQLSERVER_DATETIME2_UPDATE = GET_UPDATE(DML_SQLSERVER_DATETIME2)
# -- smalldatetime --
DML_SQLSERVER_SMALLDATETIME = GET(DML_SQLSERVER_DATE_AND_TIME, 'smalldatetime')
DML_SQLSERVER_SMALLDATETIME_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_SMALLDATETIME)
DML_SQLSERVER_SMALLDATETIME_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_SMALLDATETIME)
DML_SQLSERVER_SMALLDATETIME_UPDATE = GET_UPDATE(DML_SQLSERVER_SMALLDATETIME)
# -- datetime --
DML_SQLSERVER_DATETIME = GET(DML_SQLSERVER_DATE_AND_TIME, 'datetime')
DML_SQLSERVER_DATETIME_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_DATETIME)
DML_SQLSERVER_DATETIME_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_DATETIME)
DML_SQLSERVER_DATETIME_UPDATE = GET_UPDATE(DML_SQLSERVER_DATETIME)
# -- time --
DML_SQLSERVER_TIME = GET(DML_SQLSERVER_DATE_AND_TIME, 'time')
DML_SQLSERVER_TIME_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_TIME)
DML_SQLSERVER_TIME_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_TIME)
DML_SQLSERVER_TIME_UPDATE = GET_UPDATE(DML_SQLSERVER_TIME)
# ---- CHARACTER_STRINGS ----
DML_SQLSERVER_CHARACTER_STRINGS = GET(SQLSERVER06_DML_TYPE, 'CHARACTER_STRINGS')

# -- char --
DML_SQLSERVER_CHAR = GET(DML_SQLSERVER_CHARACTER_STRINGS, 'char')
DML_SQLSERVER_CHAR_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_CHAR)
DML_SQLSERVER_CHAR_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_CHAR)
DML_SQLSERVER_CHAR_UPDATE = GET_UPDATE(DML_SQLSERVER_CHAR)
# -- varchar --
DML_SQLSERVER_VARCHAR = GET(DML_SQLSERVER_CHARACTER_STRINGS, 'varchar')
DML_SQLSERVER_VARCHAR_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_VARCHAR)
DML_SQLSERVER_VARCHAR_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_VARCHAR)
DML_SQLSERVER_VARCHAR_UPDATE = GET_UPDATE(DML_SQLSERVER_VARCHAR)
# -- text --
DML_SQLSERVER_TEXT = GET(DML_SQLSERVER_CHARACTER_STRINGS, 'text')
DML_SQLSERVER_TEXT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_TEXT)
DML_SQLSERVER_TEXT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_TEXT)
DML_SQLSERVER_TEXT_UPDATE = GET_UPDATE(DML_SQLSERVER_TEXT)
# ---- UNICODE_CHARACTER_STRINGS ----
DML_SQLSERVER_UNICODE_CHARACTER_STRINGS = GET(SQLSERVER06_DML_TYPE, 'UNICODE_CHARACTER_STRINGS')

# -- nchar --
DML_SQLSERVER_NCHAR = GET(DML_SQLSERVER_UNICODE_CHARACTER_STRINGS, 'nchar')
DML_SQLSERVER_NCHAR_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_NCHAR)
DML_SQLSERVER_NCHAR_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_NCHAR)
DML_SQLSERVER_NCHAR_UPDATE = GET_UPDATE(DML_SQLSERVER_NCHAR)
# -- nvarchar --
DML_SQLSERVER_NVARCHAR = GET(DML_SQLSERVER_UNICODE_CHARACTER_STRINGS, 'nvarchar')
DML_SQLSERVER_NVARCHAR_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_NVARCHAR)
DML_SQLSERVER_NVARCHAR_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_NVARCHAR)
DML_SQLSERVER_NVARCHAR_UPDATE = GET_UPDATE(DML_SQLSERVER_NVARCHAR)
# -- ntext --
DML_SQLSERVER_NTEXT = GET(DML_SQLSERVER_UNICODE_CHARACTER_STRINGS, 'ntext')
DML_SQLSERVER_NTEXT_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_NTEXT)
DML_SQLSERVER_NTEXT_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_NTEXT)
DML_SQLSERVER_NTEXT_UPDATE = GET_UPDATE(DML_SQLSERVER_NTEXT)
# ---- BINARY_STRINGS ----
DML_SQLSERVER_BINARY_STRINGS = GET(SQLSERVER06_DML_TYPE, 'BINARY_STRINGS')

# -- binary --
DML_SQLSERVER_BINARY = GET(DML_SQLSERVER_BINARY_STRINGS, 'binary')
DML_SQLSERVER_BINARY_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_BINARY)
DML_SQLSERVER_BINARY_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_BINARY)
DML_SQLSERVER_BINARY_UPDATE = GET_UPDATE(DML_SQLSERVER_BINARY)
# -- varbinary --
DML_SQLSERVER_VARBINARY = GET(DML_SQLSERVER_BINARY_STRINGS, 'varbinary')
DML_SQLSERVER_VARBINARY_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_VARBINARY)
DML_SQLSERVER_VARBINARY_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_VARBINARY)
DML_SQLSERVER_VARBINARY_UPDATE = GET_UPDATE(DML_SQLSERVER_VARBINARY)
# -- image --
DML_SQLSERVER_IMAGE = GET(DML_SQLSERVER_BINARY_STRINGS, 'image')
DML_SQLSERVER_IMAGE_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_IMAGE)
DML_SQLSERVER_IMAGE_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_IMAGE)
DML_SQLSERVER_IMAGE_UPDATE = GET_UPDATE(DML_SQLSERVER_IMAGE)
# -- xml --
DML_SQLSERVER_XML = GET(SQLSERVER06_DML_TYPE, 'OTHER_DATA_TYPES').get('xml')
DML_SQLSERVER_XML_INSERT_1 = SOLE_GET_INSERT1(DML_SQLSERVER_XML)
DML_SQLSERVER_XML_INSERT_2 = SOLE_GET_INSERT2(DML_SQLSERVER_XML)
DML_SQLSERVER_XML_UPDATE = GET_UPDATE(DML_SQLSERVER_XML)
